/*
** 2608.c
** 
** Made by (seakage2h)
** Login   <seakage2h@seakage2h-ubuntu>
** 
** Started on  Thu Sep 25 15:08:11 2008 seakage2h
** Last update Sun May 12 01:17:25 2002 Speed Blue
*/

/* #include "2608.h" */
#include <stdio.h>

int main()
{
     char str[21];
     int i;
     char p_ch;			/* previous character */

     while(scanf("%s", str) != EOF){
	  p_ch = 0;
	  for(i = 0; str[i] != '\0'; i++)
	       switch(str[i]){
	       case 'B':
	       case 'F':
	       case 'P':
	       case 'V':
		    if (p_ch != 1){
			 putchar('1');
			 p_ch = 1;
		    }
		    break;
	       case 'C':
	       case 'G':
	       case 'J':
	       case 'K':
	       case 'Q':
	       case 'S':
	       case 'X':
	       case 'Z':
		    if (p_ch != 2){
			 putchar('2');
			 p_ch = 2;
		    }
		    break;
	       case 'D':
	       case 'T':
		    if (p_ch != 3){
			 putchar('3');
			 p_ch = 3;
		    }
		    break;
	       case 'L':
		    if (p_ch != 4){
			 putchar('4');
			 p_ch = 4;
		    }
		    break;
	       case 'M':
	       case 'N':
		    if (p_ch != 5){
			 putchar('5');
			 p_ch = 5;
		    }
		    break;
	       case 'R':
		    if (p_ch != 6){
			 putchar('6');
			 p_ch = 6;
		    }
		    break;
	       default:
		    p_ch = 0;
		    break;
	       }
	  putchar('\n');
     }
     return 0;
}

